import { createApp } from 'vue'
import router from '@/router'
import { createPinia } from 'pinia'
import piniaPersist from 'pinia-plugin-persist'
import App from '@/App.vue'
import ElementPlus from 'element-plus'
import 'element-plus/dist/index.css'
import * as ElementPlusIconsVue from '@element-plus/icons-vue'
import '@/assets/css/tailwind.css'

import '@/permission' // permission control
import directive from './directive'
import plugins from './plugins'

const app = createApp(App)

// 自动引入图标
Object.keys(ElementPlusIconsVue).forEach(key => {
    app.component(key, ElementPlusIconsVue[key])
})

const pinia = createPinia()
pinia.use(piniaPersist)
app.use(router).use(pinia).use(ElementPlus).use(plugins)
directive(app)
app.mount('#app')
